home *** CD-ROM | disk | FTP | other *** search
/ Larry Magid's Essential Internet / Larry Magid's Essential Internet (Quarterdeck Corporation)(1995).ISO / qsockpro.qip / EDEN.MPS < prev    next >
Text File  |  1995-10-09  |  3KB  |  92 lines

  1. # The Eden Matrix PPP and SLIP login script
  2. # Copyright 1995 Quarterdeck Corporation
  3. # 5-9-95
  4.  
  5. # Always place a comment as the first line with the name of the provider
  6. # and the type of connection.  We will attempt to display this in the 
  7. # script file requestor to aid the user in selecting an appropriate 
  8. # script since the filename may not be sufficient.
  9.  
  10. #define the variables we will need
  11.  
  12. STRING username
  13. STRING password
  14. STRING framing
  15. STRING IPAddress
  16.  
  17. # uncomment for debugging
  18. # TRACE ON  
  19.  
  20. # reset maximum login timeout.  We put this here in case it took an
  21. # unusually long amount of time to get the initial connection.    Its
  22. # probably too long but its better to be safe then sorry.
  23.  
  24. SetTimeout      90
  25.  
  26. # Get username from access method
  27. # NOTE: Some systems do not require a username.
  28. # This step will not be necessary in those cases.
  29.  
  30. CfgGetValue "Username" username
  31.  
  32. # if the Username field is empty, prompt the user for it.
  33.  
  34. IF result = 0 THEN
  35.     GetInput "Enter your user name" username
  36.     IF result = 0 THEN
  37.         PRINT "Warning, no username entered"
  38.     ELSE
  39.         PRINT "Username set to ["; username; "]"
  40.     ENDIF
  41. ENDIF
  42.  
  43. # get password from access method
  44. # NOTE: Some systems do not require a password.
  45. # This step will not be necessary in those cases.
  46. CfgGetValue "Password" password
  47.  
  48. # if the Password field is empty, prompt the user for it.
  49. IF result = 0 THEN
  50.     GetPassword "Enter your password" password
  51.     IF result = 0 THEN
  52.         PRINT "Warning, no password entered"
  53.     ELSE
  54.         # NOTE: Don't print password.
  55.         PRINT "Password set."
  56.     ENDIF
  57. ENDIF
  58.  
  59. # get framing layer (MPPPP, MPSLIP)
  60. # abort with an error if we can't read the Framing setting
  61. CfgGetValue "Framing" framing
  62. IF result = 0 THEN
  63.     ABORT "Can't read 'Framing' setting from qdeck.ini"
  64. ENDIF
  65.  
  66. CommWaitFor "login:"            # wait for login prompt
  67.     IF framing = "MPSLIP" THEN
  68.         CommSend "S"
  69.     ELSE
  70.         CommSend "P"
  71.     ENDIF
  72.     CommSend username            # send user name
  73.     CommSend "%r"                # send carriage return
  74.  
  75. CommWaitFor "Password:"            # wait for password prompt
  76.     CommSend password            # send password
  77.     CommSend "%r"                # send carriage return
  78.  
  79. IF framing = "MPSLIP" THEN        # if SLIP, we need to  get the IP address
  80.     PRINT "Getting IP address for SLIP"
  81.     CommWaitFor ") to"          # wait for string that precedes the reported
  82.                                 # IP Address
  83.     CommReadIPAddr IPAddress    # IP address should be next word
  84.  
  85.     # store the IP address
  86.     CfgSetValue "IPAddress" IPaddress
  87.     PRINT "%rIP Address set to ["; IPAddress; "]"
  88. ENDIF                            # end of SLIP logic
  89.  
  90. END                              # indicate success if we got this far
  91.  
  92.